import request from "@/utils/request";

// 修改密码
export function updatePassword(oldPass, newPass) {
    const data = {
        oldPass,
        newPass
    }
    return request({
        url: '/updatePassword',
        method: 'post',
        data: data
    })
}

// 获取收货地址
export function getAddress() {
    return request({
        url: '/getAddress',
        method: 'get'
    })
}

// 新增收货地址
export function updateAddress(data) {
    return request({
        url: '/updateAddress',
        method: 'post',
        data: data
    })
}

// 删除收货地址
export function deleteAddrss(data) {
    return request({
        url: '/deleteAddress',
        method: 'post',
        data: data
    })
}

// 获取订单记录
export function getOrders(query) {
    return request({
        url: '/getOrders',
        method: 'get',
        params: query
    })
}

//搜索订单
export function findOrders(data) {
    return request({
        url: 'findOrders',
        method: 'post',
        data: data
    })
}

//删除订单
export function deleteOrder(data) {
    return request({
        url: '/deleteOrder',
        method: 'post',
        data: data
    })
}

// 获取钱包金额
export function getRestMoney(){
    return request({
        url: '/getRestMoney',
        method: 'get'
    })
}


// 充值按钮
export function charge(count) {
    let data = {
        count,
    }
    return request({
        url: '/charge',
        method: 'post',
        data: data
    })
}

// 获取消息通知
export function getMessage(query) {
    return request({
        url: '/getMessage',
        method: 'get',
        params: query
    })
}

// 结账付款
export function payMoney(orderNum,password) {
    let data = {
        orderNum,
        password,
    }
    return request({
        url: '/payMoney',
        method: 'post',
        data: data
    })
}
